package com.webwork.lims.stock.service;

import java.util.List;

import com.webwork.lims.stock.dataobject.Stock;
import com.webwork.lims.util.Paging;

public interface StockService {

	public int count(Stock queryObj);

	public List<Stock> query(Stock queryObj, Paging paging);
	
	public Stock get(String sku);

	public void insert(Stock stock);
	
	public void update(Stock stock);

	/**
	 * 检查库存
	 * @param sku
	 * @param amount 所需库存号
	 * @return true 足够库存
	 *         false 不够库存
	 */
	public Boolean checkStock(String sku, Integer amount);

	/**
	 * 使用库存
	 * @param sku
	 * @param amount
	 * @return
	 */
	public String useStock(String sku, Integer amount);

	/**
	 * 增加库存
	 * @param sku
	 * @param amount
	 */
	public void addStock(String sku, Integer amount);

	/**
	 * 删除库存
	 * @param sku
	 */
	public void delStock(String sku);

}
